package com.heima.wemedia.test;

import com.heima.file.service.FileStorageService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

@SpringBootTest
public class osstest {

    @Autowired
    FileStorageService fileStorageService;
    @Value("${file.oss.prefix}")
    String prefix;
    @Test
    public void upload() throws FileNotFoundException {
        FileInputStream inputStream = new FileInputStream("D:\\meinv004.jpg");
        String path = fileStorageService.store(prefix, "mm.jpg", inputStream);
        System.out.println(path);
    }
}
